﻿using System.Collections.Generic;
using Metro.Kashikoi.Service.Common.Entity;
using Metro.Kashikoi.Service.Item.Business;
using Metro.Kashikoi.ServiceContract.Item;

namespace Metro.Kashikoi.Service.Test.Item
{
    class MockItemFacade : IItemFacade
    {
        public IUnitOfWork Context { get; private set; }
        public int EntityId { get; private set; }
        public object Entity { get; private set; }
        public object Entity1 { get; private set; }
        public object Entity2 { get; private set; }
        public object Entity3 { get; private set; }

        public void DeleteItemsOfVendor(IUnitOfWork context, int vendorId, IList<int> deletedItems)
        {
            this.Context = context;
            this.Entity = deletedItems;
            this.EntityId = vendorId;
        }

        public void DeleteItemsOfCategory(IUnitOfWork context, int categoryId, IList<int> deletedItems)
        {
            this.Context = context;
            this.EntityId = categoryId;
            this.Entity = deletedItems;
        }

        public void CreateItem(IUnitOfWork context, StockItem item, Category category, Vendor vendor)
        {
            this.Context = context;
            this.Entity1 = item;
            this.Entity2 = category;
            this.Entity3 = vendor;
        }

        public void UpdateItem(IUnitOfWork context, StockItem item, Category category, Vendor vendor)
        {
            this.Context = context;
            this.Entity1 = item;
            this.Entity2 = category;
            this.Entity3 = vendor;
        }

        public void DeleteItem(IUnitOfWork context, int itemId)
        {
            this.Context = context;
            this.EntityId = itemId;
        }

        public IList<StockItem> GetAllItems(IUnitOfWork context)
        {
            this.Context = context;
            return new List<StockItem>();
        }

        public void ImportItems(IUnitOfWork context, string path)
        {
            this.Context = context;
            this.Entity = path;
        }

        public void CreateChargeDepartment(IUnitOfWork context, ChargeDepartment chargeDepartment)
        {
            this.Context = context;
            this.Entity = chargeDepartment;
        }

        public void UpdateChargeDepartment(IUnitOfWork context, ChargeDepartment chargeDepartment)
        {
            this.Context = context;
            this.Entity = chargeDepartment;
        }

        public void DeleteChargeDepartment(IUnitOfWork context, int chargeDepartmentId, IList<int> deletedItems)
        {
            this.Context = context;
            this.Entity = deletedItems;
            this.EntityId = chargeDepartmentId;
        }

        public IList<ChargeDepartment> GetAllChargeDepartments(IUnitOfWork context)
        {
            this.Context = context;
            return new List<ChargeDepartment>();
        }

        public StockItem GetItem(IUnitOfWork context, int id, bool includeCategory, bool includeVendor, bool includeChargeDepartment)
        {
            this.Context = context;
            this.EntityId = id;
            this.Entity1 = includeCategory;
            this.Entity2 = includeVendor;
            this.Entity3 = includeChargeDepartment;
            return new StockItem();
        }
    }
}
